import requests
import re
# url = 'https://www.douyin.com/jingxuan'
# headers = {
#     'Cookie':(
#         'user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36;'
#         'bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtcmVlLXB1YmxpYy1rZXkiOiJCS3djYU9GcjB3OStibzRmY3Mvenl5Yk1jSnhhOWh6VmM1UHBPUHNQMERzT2NmVXZYYmI1TmpYdUN3TEsxUXhLQ0d1VzVUcWtGbERnOFoxeE94cFE1K2s9IiwiYmQtdGlja2V0LWd1YXJkLXdlYi12ZXJzaW9uIjoyfQ%3D%3D;'
#         'bd_ticket_guard_client_data_v2=eyJyZWVfcHVibGljX2tleSI6IkJLd2NhT0ZyMHc5K2JvNGZjcy96eXliTWNKeGE5aHpWYzVQcE9Qc1AwRHNPY2ZVdlhiYjVOalh1Q3dMSzFReEtDR3VXNVRxa0ZsRGc4WjF4T3hwUTUraz0iLCJyZXFfY29udGVudCI6InNlY190cyIsInJlcV9zaWduIjoiSVQxVzdzKzNVNjFpamVwU0ZyT2ZSSVhoT09jMFNYbERBQnJKWDRGQ1Fubz0iLCJzZWNfdHMiOiIjSllsdFpnWkExSzh2d0pLODVGUFpVaCtHelhKYk9SRHJscy9lcThZVllSSVpzbEJGeS93UEhreStBN2duIn0%3D;'
#         'bit_env=Zxixcjm5Jl5tXLK0jxRVHcLOfj7gQdcXkGhAZaVkIHrQ0tWPPkjHnCYI7C4iWXqSMghBDxBpJhqy6VTQEmJ9dFWrjFNzWFY4JRIh2ApSOeJmEwaOz670iMwdntHzMJBASGNanEnCWTwkmp0k9byK837VOaXnZ_lnIT0j9OOSgz-ERDUIrgR6P0AYN9F4Ne-CXDMa9Ueay_og5lEJQcamOSXDppLN2pokvbEnDXrHW516pe8J87mjImPRCs4mvWNC1ehQq2BbuI08CvK7d24wRaqzeSyOzgzJZH69_TyNujlXvfZw0c90AKmOEHWhclh6dXvclLhdpINmXyJDyVX2msnslGOd1XLArwv6t4tH3K5RHtyg62h9fkqwsNYEf5M-f9qIJc3sisIThfaQyvnNfF3qvVZ5T47GIHHLJWGd0hhw5UA64ukqDtHzXn2eWBB0U9675bX9Qeeadeevwv0hvcCGYz0YaVzM__6JrcoEg-f9DQwOX5Mml93IDLzsT1gx;'
#         'fpk1=U2FsdGVkX1+gPBEaN26hOqMv2AfIPzhYFbZgJi2T1Rwh5HMI2WVuPNBZYFGH+jrpvEr7QmQUu6VJ54GmZxVBJA==;'
#         'fpk2=2204ee63bef2f351470a66ffe1bb020e;'
#         'fg_uid=RID2025070510565672E9C99BCB874206881A;'
#         'biz_trace_id=1481410e;'
#         'odin_tt=34c35d6264c37600067ae3dbb5eda64936b83cd3ae20b6ec536a50e3da4ca2fabbd93db7e60bd7a7eb9ab439eb927cdd14d94f2127c041153a72846b99cdc75aa93c9269a854c9dc64a8b071c3f627cf;'
#         'passport_csrf_token=34c35d6264c37600067ae3dbb5eda64936b83cd3ae20b6ec536a50e3da4ca2fabbd93db7e60bd7a7eb9ab439eb927cdd14d94f2127c041153a72846b99cdc75aa93c9269a854c9dc64a8b071c3f627cf;'
#         '__security_mc_1_s_sdk_crypt_sdk=17bca7cb-4d7b-a92e;' ),
#     "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
#     "Referer": "https://www.douyin.com/",
#     "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
#     "Connection": "keep-alive"
# }
# response = requests.get(url, headers=headers)
# print(response.status_code)
#
#
# video_urls = re.findall('<div class="eDsqb73g Ety_VxKJ waterfall-videoCardContainer jingxuanVideoCard" target="_blank" rel="noopener noreferrer" href="(.*?)">', response.text)
# for video_url in video_urls:
#     headers1 = {
#         'Cookie': (
#             '__ac_nonce=069007baf000a08245726;'
#             '__ac_signature=_02B4Z6wo00f01-EkHnQAAIDAvrEVuw4i7bvhBBrAAJFSb4;'
#             'bd_ticket_guard_client_data=eyJiZC10aWNrZXQtZ3VhcmQtdmVyc2lvbiI6MiwiYmQtdGlja2V0LWd1YXJkLWl0ZXJhdGlvbi12ZXJzaW9uIjoxLCJiZC10aWNrZXQtZ3VhcmQtcmVlLXB1YmxpYy1rZXkiOiJCS3djYU9GcjB3OStibzRmY3Mvenl5Yk1jSnhhOWh6VmM1UHBPUHNQMERzT2NmVXZYYmI1TmpYdUN3TEsxUXhLQ0d1VzVUcWtGbERnOFoxeE94cFE1K2s9IiwiYmQtdGlja2V0LWd1YXJkLXdlYi12ZXJzaW9uIjoyfQ%3D%3D;'
#             'bd_ticket_guard_client_data_v2=eyJyZWVfcHVibGljX2tleSI6IkJLd2NhT0ZyMHc5K2JvNGZjcy96eXliTWNKeGE5aHpWYzVQcE9Qc1AwRHNPY2ZVdlhiYjVOalh1Q3dMSzFReEtDR3VXNVRxa0ZsRGc4WjF4T3hwUTUraz0iLCJyZXFfY29udGVudCI6InNlY190cyIsInJlcV9zaWduIjoia2czRmJPc2E0Z1djbkcyTkZtZlVxTWR3SitrdXB2R2I5eWJzUW5GcE95VT0iLCJzZWNfdHMiOiIjVkVYc2RqMkpwS3AyQWpISHYwSU9pOG9sYkUwYy9xTU1SZEN6U3RCaTJZc2VDVmpxeE9xSlJVelR0K01iIn0%3D;'
#             ),
#         "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
#
#         "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
#         "Connection": "keep-alive"
#     }
#     # print(video_url)
#     video_response = requests.get(f'https:{video_url}', headers=headers)
#     print(video_response.status_code)




url = 'https://v3-web.douyinvod.com/a25b977f6391fe0b54cd63e4618a778c/69036020/video/tos/cn/tos-cn-vd-0026/oQGAufnlxgm9DfAAAJjEAuBCgA0FRUNFoYkWAG/media-video-hvc1/?a=6383&ch=0&cr=8&dr=0&er=1&lr=default&cd=0%7C0%7C0%7C3&cv=1&br=550&bt=550&cs=4&ds=6&mime_type=video_mp4&qs=11&rc=PDw3aTxlNmQ4OTtkZTVkO0BpamZtams5cmU6NjMzNGkzM0BiYDE1Nl9iNWMxY14xYl8zYSNfZWhpMmRrZjZhLS1kLS9zcw%3D%3D&btag=80000e00038000&cquery=100o_101s&dy_q=1761741853&l=20251029204413EC157085CDBB04D163E3'
response = requests.get(url)
print(response.status_code)